/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Progrmas;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Lab
 */
public class Rimas {

    public static void main(String args[]) throws FileNotFoundException, IOException{


        //leee un archivo y compara las lineas y revisa las tres ultimas letras de la linea riman o son iguales
        File f=new File("C:\\archi.txt");
        BufferedReader entrada= new BufferedReader(new FileReader(f));
        if(f.exists()){
            String s=entrada.readLine();
            String s2=entrada.readLine();
            String s3=entrada.readLine();
            String s4=entrada.readLine();
            System.out.println(s);
            System.out.println(s2);
            System.out.println(s3);
            System.out.println(s4);
            System.out.println("************************************************    ");
            if(s.endsWith(s3.substring(s3.length()-3, s3.length()))&&s2.endsWith(s4.substring(s4.length()-3, s4.length()))){
                System.out.println("Si son rimas");
                
            }
          else{
                System.out.println("No son rimas");
            }
        }
    }
}
